<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<script type="text/javascript" src="/${initParam.context_root }/etc/js/jquery.js"></script>
<script type="text/javascript">
function registerDeliveryEnterprise(){

		if(($("#enterpriseName").val()=='')){
			alert("업체명은 필수 사항입니다.");
			$("#enterpriseName").focus();
			return;
		}
		if(($("#tel").val()=='')){
			alert("전화번호는 필수 사항입니다.");
			$("#tel").focus();
			return;
		}
		if($("#email").val()==''){
			alert("E-Mail은 필수 사항입니다.");
			$("#email").focus();
			return;
		}
		if($("#defaultDeliveryFee").val()==''){
			alert("기본배송비는 필수 사항입니다.");
			$("#defaultDeliveryFee").focus();
			return;
		}
		if($("#specialnessLocationName").val()==''){
			alert("특수지역명은 필수 사항입니다.");
			$("#specialnessLocationName").focus();
			return;
		}
		if($("#locationAddFee").val()==''){
			alert("지역추가금은 필수 사항입니다.");
			$("#locationAddFee").focus();
			return;
		}
		if($("#homepage").val()==''){
			alert("홈페이지는 필수 사항입니다.");
			$("#homepage").focus();
			return;
		}
				
		$.ajax({
			url:"/${initParam.context_root}/myshop/registerDeliveryEnterprise.do",
			type:"POST",
			data:$("#deliveryEnterpriseForm").serialize(),
			dataType:"JSON",
			success:function(JSON){
				if(JSON.success==1){
					alert("등록이 완료되었습니다.");
				}else if(JSON.success==-1){
					alert("변경되었습니다.");
				}else{
					alert("실패");
				}
			}
		});
}
</script>
<style type="text/css">
 
  	.headline {margin-top: 0px; margin-bottom: 10px; }
  	.headtext {font-weight: bolder; color:#B061BF; margin-top: 20px; margin-bottom: 0px; font-style: 돋음; }
</style>
<h2 class="headtext">배송업체 관리</h2>
<hr class="headline"><br>

<form id="deliveryEnterpriseForm">
<table border="1" collapse="0">
	<tr align="center" style="background-color:#453949; color: white;">
		<td>업체명</td><td><input type="text" id="enterpriseName" name="enterpriseName"></td>
	</tr>
	<tr>
		<td>전화번호</td><td><input type="text" id="tel" name="tel"></td>
	</tr>
	<tr>
		<td>전화번호2</td><td><input type="text" id="tel2" name="tel2"></td>
	</tr>
	<tr>
		<td>E-Mail</td><td><input type="text" id="email" name="email"></td>
	</tr>
	<tr>
		<td>기본배송비</td><td><input type="text" id="defaultDeliveryFee" name="defaultDeliveryFee"></td>
	</tr>
	<tr>
		<td>특수지역명</td><td><input type="text" id="specialnessLocationName" name="specialnessLocationName"></td>
	</tr>
	<tr>
		<td>지역추가배송비</td><td><input type="text" id="locationAddFee" name="locationAddFee"></td>
	</tr>
	<tr>
		<td>홈페이지주소</td><td><input type="text" id="homepage" name="homepage"></td>
	</tr>
	<tr>
		<td colspan="2"><input type="button" value="배송업체정보등록" onclick="registerDeliveryEnterprise()"></td>
	</tr>
</table>
</form>
